package com.lwq.project.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lwq.project.dao.custom.CustomUserMapper;
import com.lwq.project.model.User;
import com.lwq.project.service.UserService;

@Service
public class UserServiceImpl implements UserService {
	
	@Autowired
	private CustomUserMapper customUserMapper;
	public String getIdByNameAndPwd(String uName,String uPwd) {
		Map<String,Object> map = new HashMap<String,Object>();
		map.put("uName", uName);
		map.put("uPwd", uPwd);
		return customUserMapper.getIdByNameAndPwd(map);
	}
	public List<User> getUserByAll(Map<String,Object> map) {
		return customUserMapper.getUserByAll(map);
	}
	public int getCount(Map<String, Object> map) {
		return customUserMapper.getCount(map);
	}
	public int updateUser(User user) {
		return customUserMapper.updateByPrimaryKeySelective(user);
	}
	public int insertUser(User user) {
		return customUserMapper.insertSelective(user);
	}
	public int delUser(String[] uId) {
		return customUserMapper.delUserByIds(uId);
	}

}
